// Copyright Epic Games, Inc. All Rights Reserved.

#include "MaterailSetPluginBPLibrary.h"
#include "MaterailSetPlugin.h"

UMaterailSetPluginBPLibrary::UMaterailSetPluginBPLibrary(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{

}

void UMaterailSetPluginBPLibrary::MaterailSet(UMaterialInstance* Param, EBlendMode BlendMode)
{
	//Param->BlendMode = BlendMode;
	Param->BasePropertyOverrides.bOverride_BlendMode = true;
	Param->BasePropertyOverrides.BlendMode = BlendMode;

	//Param->UpdateOverridableBaseProperties();
	UE_LOG(LogTemp, Log, TEXT("1"));
	
}

void UMaterailSetPluginBPLibrary::MaterailIfBlendModeToTargetBlendMode(UMaterialInstance* Param, EBlendMode BlendMode, EBlendMode TargetBlendMode)
{


	if(Param->BasePropertyOverrides.BlendMode == BlendMode || Param->BasePropertyOverrides.bOverride_BlendMode == false)
	{
		Param->BasePropertyOverrides.bOverride_BlendMode = true;
		Param->BasePropertyOverrides.BlendMode = TargetBlendMode;
	}

	UE_LOG(LogTemp, Log, TEXT("12"));



}

